import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LogIn.vue')
},
// {
//   path: '/changePassword',
//   name: 'changePassword',
//   component: () => import('../views/ChangePassword.vue')
// },
  {
  path: '/',
  component: () => import(/* webpackChunkName: "about" */ '../Layout/IndexView.vue'),
  children:[
  {
    path: '/home',
    name: 'home',
    component: HomeView
  },
  {
    path: '/account',
    name: 'account',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AccountInfo.vue'),
  },
  {
    path: '/getOrder',
    name: '',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */  '../views/GetOrder.vue')
  },
  {
    path: '/OrderList',
    name: '',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */  '../views/OrderList.vue')
  },
  {
    path: '/event/createEvent',
 
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/CreateEvent.vue')
  },
  {
    path: '/event/eventList',
 
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/EventList.vue')
  },
  {
    path: '/event/bedList',
 
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/BedList.vue')
  },
  // {
  //   path: '/:building_id/details',
  //   name: 'detail',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/BuildingDetail.vue')
  // },
  {
    path: '/:building_id/details',
    name: 'detail',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/BuildingDetail.vue')
  },
  {
    path: '/roleManagement',
    name: '角色管理',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/RoleManagement.vue')
  },
  {
    path: '/PermissionManagement',
    name: '权限管理',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/PermissionView.vue')
  },
  {
    path: '/UserManagement',
    name: '用户管理',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/UserManagement.vue')
  },
  {
    path: '/UserManagement',
    name: '用户管理',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/UserManagement.vue')
  },
  // {
  //   path: '/:building_id/:room_id',
  //   name: 'room',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/RoomDetail.vue')
  // },
 
  {
    path: '/error/:status',
    name: 'error',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */  '../views/ErrorPage.vue')
  },
//   {
//     path: '/:catchAll(.*)',
//     name: 'ErrorPage',
//     component: () => import(/* webpackChunkName: "about" */  '../views/ErrorPage.vue')
//  }



]},
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
